package com.cloud.poetry.base.feign.fallback;

import com.cloud.poetry.base.feign.FileFeignClient;
import com.cloud.poetry.base.feign.fallback.impl.FileFeignClientImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mengxj
 */
@Component
public class FileFeignClientFallBack implements FallbackFactory<FileFeignClient> {

    @Override
    public FileFeignClient create(Throwable throwable) {
        FileFeignClientImpl client = new FileFeignClientImpl();
        client.setThrowable(throwable);
        return client;
    }
}
